<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>分拣计划添加</h2>
    </div>
    <form action="{:U()}" method="post" enctype="multipart/form-data" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">计划名称</label>
            <div class="controls">
                <input type="text" class="text input-large" name="planname" value="{$data.planname}"><span>（例：20160730am 或 20160730pm 注意：am指早班，pm指晚班）</span>
            </div>
        </div>
        <div class=" form-item">
            <label class="item-label">计划时间</label>
            <div class="sleft">
                日期：
                <input type="text" name="planstart" class="text input-large time" value="{$data.planstart}" placeholder="请选择计划开始时间"   style="height: 30px;width:200px" />
                到：
                <input type="text" name="planend" class="text input-large time" value="{$data.planend}" placeholder="请选择计划结束时间"   style="height: 30px;width:200px" />
            </div>
            <!--<div class="sleft">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('')}"><i class="btn-search"></i></a>
            </div>-->
        </div>
        <div class="form-item">
            <label class="item-label">计划备注</label>
            <div class="controls">
                <input type="text" class="text input-large" name="remark" value="{$data.remark}">
            </div>
        </div>
        <div class="form-item">
            <button class="btn submit-btn  ajax-post" id="submit" type="submit" target-form="form-horizontal">创 建</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);
                    return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        $(function () {
            $('.time').datetimepicker({
                format: 'Y-m-d H:i:s',
                language: "zh-CN",
                minView: 2,
                autoclose: true,
                step:30
            });
        });

        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
                url += '&' + queryselect;
            } else {
                url += '?' + query;
                url += '?' + queryselect;
            }

            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        highlight_subnav('{:U('Sort/planindex')}');
    </script>
</block>